package com.funwell;

import com.ace.cache.EnableAceCache;
import com.funwell.server.config.SystemInit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
@EnableAutoConfiguration
@EnableAceCache
@MapperScan(basePackages = "com.funwell.modules.dao")
public class LaunchServerApplication {

	private static Logger logger = LoggerFactory.getLogger(LaunchServerApplication.class);

	public static void main(String[] args) {
		SpringApplication app = new SpringApplication(LaunchServerApplication.class);
		app.addListeners(new SystemInit());
		app.run(args);
	}


	/**
	 * 初始化任务数据
	 */
	private static void createJobSchedule(){
		/*logger.info("初始化任务数据开始，开始时间：{}",new Date());
		RedisService redisService= SpringUtil.getBean(RedisService.class);
		redisService.delete("HCRM_TASK");

		//生成推荐任务数据
		String[] jobNameArray=new String[3];
		jobNameArray[0]="com.tynet.hcrm.modules.taskservice.SmsTaskService";
		jobNameArray[1]="com.tynet.hcrm.modules.taskservice.WeChatTaskService";
		jobNameArray[2]="com.tynet.hcrm.modules.taskservice.AppTaskService";
		for (String jobName:jobNameArray
					) {
			HScheduleTrigger trigger1=new HScheduleTrigger();
			trigger1.setJobGroup("test_push");
			trigger1.setJobName(jobName);
			trigger1.setCron("0 0,30 7-20 * * ? *");
			trigger1.setStatus("1");
			trigger1.setJobData("1");
			redisService.lpush("HCRM_TASK",trigger1);
		}
		//生成其他任务*/
	}


}
